import axios from '@/api/fetch';
import SERVER from '@/api/server';
//分页搜索
export const selectPageByExample = (params) => axios.post(`${SERVER.CLAIMFAC}/rPGuaranteeOil/selectPageByExample`, params);
//保存
export const saveOne = (params) => axios.post(`${SERVER.CLAIMFAC}/rPGuaranteeOil/saveOne`, params);
//编辑时回显
export const selectById = params => axios.get(`${SERVER.CLAIMFAC}/rPGuaranteeOil/selectById/${params.id}`);
//保存编辑
export const editSave = params => axios.post(`${SERVER.CLAIMFAC}/rPGuaranteeOil/updateByPtId`,  params );
//主页面的单条删除
export const deleteOne = (id) => axios.get(`${SERVER.CLAIMFAC}/rPGuaranteeOil/updateDeleteById/${id}` );
//批量启动
export const piliangqiyong = data => axios.post(`${SERVER.CLAIMFAC}/rPGuaranteeOil/updateEnableByIds`,  null ,{params : data} );
//批量停用
export const piliangtingyong = data => axios.post(`${SERVER.CLAIMFAC}/rPGuaranteeOil/updateEnableByIds`,  null ,{params : data} );
//导出
export const getListForExport = (params) => axios.post(`${SERVER.CLAIMFAC}/rPGuaranteeOil/getListForExport`, params, {
  responseType: 'blob'
});
//下载中心导出
export const exporturl = params => axios.post(`/api/cmscloud.excel/downloadExcel/exportExcel/${params.CODE}`, params);

//导出模版
export const downloadModel = params => {
  const url = `${SERVER.CLAIMFAC}/rPGuaranteeOil/exportModel`;
  return axios({
    url,
    method: 'post',
    responseType: 'blob'
  });
};


